﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Freshome.m.fox
{
    internal static class AssemblyInfox
    {
        public static string Title
        {
            get
            {
                object[] attrs = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
                if (attrs.Length == 0) return string.Empty;
                else return ((AssemblyTitleAttribute)attrs[0]).Title;
            }
        }
        public static string Product
        {
            get
            {
                object[] attrs = Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
                if (attrs.Length == 0) return string.Empty;
                else return ((AssemblyProductAttribute)attrs[0]).Product;
            }
        }
        public static string Version
        {
            get
            {
                return Assembly.GetExecutingAssembly().GetName().Version.ToString();
            }
        }
        public static string Copyright
        {
            get
            {
                object[] attrs = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
                if (attrs.Length == 0) return string.Empty;
                else return ((AssemblyCopyrightAttribute)attrs[0]).Copyright;
            }
        }
        public static string Company
        {
            get
            {
                object[] attrs = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
                if (attrs.Length == 0) return string.Empty;
                else return ((AssemblyCompanyAttribute)attrs[0]).Company;
            }
        }
    }
}
